package com.tjsinfo.tjsoa.mail.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.tjsinfo.tjsoa.mail.bo.ITjsDraftBo;
/**
 * 草稿箱移动
 * @author wangxiaowei
 *
 */
public class EmailDrefMoveAction extends Action{
	private ITjsDraftBo tjsDraftBo;
	public ITjsDraftBo getTjsDraftBo() {
		return tjsDraftBo;
	}
	public void setTjsDraftBo(ITjsDraftBo tjsDraftBo) {
		this.tjsDraftBo = tjsDraftBo;
	}
	@Override
	public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		// TODO Auto-generated method stub
		String[] strarray = request.getParameterValues("checkbox2");//草稿数组
		
		if (tjsDraftBo.moveTjsDraf(strarray, request.getParameter("foldid"))) {
			request.setAttribute("linkurl", "tjsinfo/tjsoa/mail/emailDraftList.do");
			request.setAttribute("message", "email.message.movemail");
			return mapping.findForward("success");
			
		} else {
			return mapping.findForward("error");
		}
	}
	
}
